package edu.ubb.remeye.client.settings;

import org.apache.mina.core.session.IoSession;

/**
 * Client runtime settings class.
 * 
 * @author Andrew Ianicicau
 *
 */
public class ClientRuntimeSettings {

	///////////////////////////////////////////////////////////////////////////////////
	////		ATTRIBUTES - ClientRuntimeSettings
	///////////////////////////////////////////////////////////////////////////////////

	/**
	 * Instance of class for singleton design pattern.
	 */
	private static ClientRuntimeSettings settings;
	
	/**
	 * The password the client entered.
	 */
	private String clientPassword;
	
	/**
	 * The active session.
	 */
	private IoSession clientSession;

	
	
	///////////////////////////////////////////////////////////////////////////////////
	////		CONSTRUCTORS - ClientRuntimeSettings
	///////////////////////////////////////////////////////////////////////////////////

	private ClientRuntimeSettings() {
		
	}

	
	
	///////////////////////////////////////////////////////////////////////////////////
	////		METHODS - ClientRuntimeSettings
	///////////////////////////////////////////////////////////////////////////////////
	
	/**
	 * Singleton design pattern instance provider method.
	 */
	public static ClientRuntimeSettings getInstance() {
		if(settings == null)
			settings = new ClientRuntimeSettings();
		return settings;
	}
	
	public String getClientPassword() {
		return settings.clientPassword;
	}
	
	public void setClientPassword(String password) {
		settings.clientPassword = password;
	}
	
	public IoSession getClientSession() {
		return clientSession;
	}

	public void setClientSession(IoSession clientSession) {
		this.clientSession = clientSession;
	}
	
}
